<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js">
    </script>
</head>
<body>
<p>拦截器</p>
<br><br><br><br>
<button id="but1">点击事件，跳转</button>
${id} <br>
${name}
<script type="text/javascript">
    var user = {id:1,name:"shine"};
    $("#but1").click(function (){
        $.ajax({
            url:'${pageContext.request.contextPath}/user/users',
            type:'post',
            contentType:"application/json",//声明请求参数类型为 json
            data:JSON.stringify(user),// 转换js对象成json
            success:function(){//ret
                console.log(1111);
            }
        });
    })

</script>
</body>
</html>
